<?php
session_start();
?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-Transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <title>Rotaract DLSU</title>
        <meta http-equiv="Content-Type" content="text/html"/>
        <meta name="robots" content="index,follow"/>
        <meta name="distribution" content="global"/>
        <meta name="description" content=""/>
        <meta name="keywords" content=""/>
        <link href="css/style.css" rel="stylesheet" type="text/css" media="screen" />
        <link rel="stylesheet" href="css/jquery-ui-1.8.21.custom.css"/>
        <link rel="stylesheet" href="css/demos.css"/>
        <script src="js/jquery-1.7.2.min.js"></script>
        <script src="js/jquery.ui.core.js"></script>
        <script src="js/jquery.ui.widget.js"></script>
        <script src="js/jquery.ui.datepicker.js"></script>

        <script>
            $(function() {
                $( "#datepicker" ).datepicker({
                    changeMonth: true,
                    changeYear: true,
                    dateFormat: 'yy-mm-dd'
                });
            });
        </script>

    </head>
    <body>
        <div id="container2">
            <div id="main3">
                <table width="100%" cellspacing="0" cellpadding="0">
                    <tr>
                        <td class="main_nav">
                            <div id="main_text2"> 
                                <center>
                                    <h2>Edit an Agenda</h2>
                                    <?
                                    include 'DBLibrary/config.php';
                                    include 'DBLibrary/openDB.php';
//                                    select specified database in config.php
                                    mysql_select_db($dbname);
                                    $query = "SELECT * FROM agenda order by date asc";
                                    $result = mysql_query($query) or die(mysql_error());

                                    if (isset($confirm)) {
                                        echo "<br/>";
                                        echo "<h3>$confirm</h3>";
                                    }
                                    ?>
                                    <form name="foredit" action="RAC-editAgendaUI2.php" method="POST" >
                                    <table border ="1" cellpadding="10" class="myTable">
                                        <tr>
                                            <td><b>Select</b></td>
                                            <td><b>Date of Agenda</b></td>
                                            <td><b>Place of Agenda</b></td>
                                            <td><b>Description</b></td>
                                            <td><b>Start Time</b></td>
                                            <td><b>End Time</b></td>
                                        </tr>
                                        <br/>
                                        <br/>
                                        <?
//                                        get all values inside the rotaract.agenda database and display 
                                        while ($row = mysql_fetch_array($result)) {
                                            $idAgenda = $row['id'];
                                            $dateAgenda = $row['date'];
                                            $placeAgenda = $row['place'];
                                            $descAgenda = $row['desc'];
                                            $sTimeAgenda = $row['sTimeAgenda'];
                                            $eTimeAgenda = $row['eTimeAgenda'];

                                            echo ' <tr>';
                                            echo "     <td><input type='radio' name='idAgenda' value='$idAgenda'/></td>";
                                            echo '     <td>' . $dateAgenda . '</td>';
                                            echo '     <td>' . $placeAgenda . '</td>';
                                            echo '     <td>' . $descAgenda . '</td>';
                                            echo '     <td>' . $sTimeAgenda . '</td>';
                                            echo '     <td>' . $eTimeAgenda . '</td>';
                                            echo '</tr>';
                                        }
                                        ?>
                                    </table>
<!--                                        submit selected radio button-->
                                        <input type="submit" name="submit" value="Edit"/>
                                    </form>
                                    <br/>
                                    <br/>
<!--                                    <form action="editAgenda.php" method="POST" >
                                        <h6>Enter the ID of the Agenda that you would want to edit.</h6>
                                        <input type="text" name="idAgenda"/>
                                        <input type="submit" name="submit" value="Edit"/>
                                    </form>-->
                                </center>
                            </div>
                        </td>

                    </tr>
                </table>
            </div>
        </div>
    </body>
</html>

